<template>
  <div>
    学生管理页面
    <AddUsers @addList="addList" :list="list"></AddUsers>
    <StudentList :list="list"></StudentList>
  </div>
</template>
<script lang='ts' setup>
import { ref, onMounted } from 'vue';
import { getuserlist } from '@/serveice/userinfo';
import AddUsers from '@/components/AddUsers.vue';
import StudentList from '@/components/StudentList.vue';
let list: any = ref([]);
onMounted(async () => {
  let { data } = await getuserlist({ usertype: 2 });
  if (data.code == 200) {
    list.value = data.list
  }
})
function addList(item: any) {
  list.value = [...list.value, ...item]
}
</script>
<style lang='less' scoped>

</style>